package com.ThreadStudy.StudyDemo;

public class TestThreadDown2 implements Runnable{

    public String url;
    public String name;


    public  TestThreadDown2(String url,String name){
        this.url=url;
        this.name=name;
    }


    @Override
    public void run() {
        WebDownloader webDownloader = new WebDownloader();
        webDownloader.downloader(url,name);
        System.out.println("下载了文件名为:"+name);
    }

    public static void main(String[] args) {
        TestThreadDown2 t = new TestThreadDown2("https://img2020.cnblogs.com/blog/2508133/202109/2508133-20210920182859176-1378059383.png","1.png");
        TestThreadDown2 t1 = new TestThreadDown2("https://img2020.cnblogs.com/blog/2508133/202109/2508133-20210920182847694-1327752584.png","2.png");
        TestThreadDown2 t2 = new TestThreadDown2("https://img2020.cnblogs.com/blog/2508133/202109/2508133-20210920183237097-1882601877.png","3.png");


        new Thread(t).start();
        new Thread(t1).start();
        new Thread(t2).start();


    }


}


